from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from time import sleep

redact = webdriver.Firefox()
redact.implicitly_wait(10)
redact.get('https://adviser.raysyun.com/login')  # UAT
# redact.get('https://adviser.raysgo.com/login')  # 测试环境
redact.maximize_window()
redact.find_element(
    By.CSS_SELECTOR, '[placeholder="请输入手机号"]').send_keys('编委会主编')
redact.find_element(
    By.CSS_SELECTOR, '[placeholder="请输入密码"]').send_keys('Rm123456')
redact.find_element(By.CLASS_NAME, 'login-btn').click()
app = redact.find_element(By.ID, 'APP')
ActionChains(redact).move_to_element(app).perform()
app.click()
sleep(5)
redact.find_element(
    By.CSS_SELECTOR, '#APP>h5>span>div>span:nth-child(2)>span').click()

redact.find_element(By.CSS_SELECTOR, '[placeholder="全部（可输入名称）"]').click()

redact.find_element(By.CSS_SELECTOR, 'ul>div:nth-child(1)>p').click()
redact.find_element(
    By.CSS_SELECTOR, '.select-button>button:nth-child(1)').click()
redact.find_element(By.CSS_SELECTOR, '[class*="btn-common"]').click()
